package com.SwaggerTest;

import com.demo.swagger.User;
import io.swagger.annotations.*;
import org.springframework.web.bind.annotation.*;

import java.util.*;

/**
 * Created by samuel on 2017/12/4.
 */
@Api(value = "API - VehiclesController", description = "用户接口详情")
@RestController
@RequestMapping("/test")
public class SwaggerController{
    static Map<String, User> users = Collections.synchronizedMap(new HashMap<String,User>());


//    @ApiOperation(value="获取用户列表", notes="")
//    @ApiResponses(value = {
//            @ApiResponse(code = 200, message = "Successful — 请求已完成"),
//            @ApiResponse(code = 400, message = "请求中有语法问题，或不能满足请求"),
//            @ApiResponse(code = 401, message = "未授权客户机访问数据"),
//            @ApiResponse(code = 404, message = "服务器找不到给定的资源；文档不存在"),
//            @ApiResponse(code = 500, message = "服务器不能完成请求")}
//    )
//    @RequestMapping(value={""}, method= RequestMethod.GET)
    @ResponseBody
    @RequestMapping(value = "/helloworld", method = RequestMethod.GET)
    @ApiOperation(nickname = "swagger-helloworld", value = "Swagger的世界", notes = "测试HelloWorld")
    public String helloWorld(@ApiParam(value = "昵称") @RequestParam String nickname) {
        return "Hello world, " + nickname;
    }

}
